import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: 'home',
    },

    {
      path: '/home',
      name: 'home',
      component: () => import('@/views/home.vue'),
      meta: {
        title: '首页'
      },

      children: [
        {
          path: '/Dashboard',
          name: 'Dashboard',
          component: () => import('@/views/Dashboard.vue'),
          meta: {
            title: '首页'
          },
        },
        {
          path: '/user',
          name: 'user',
          component: () => import('@/views/user.vue'),
          meta: {
            title: '用户管理'
          },
        },
        {
          path: '/goods',
          name: 'goods',
          component: () => import('@/views/goods.vue'),
          meta: {
            title: '商品管理'
          },
        },
        {
          path: '/live',
          name: 'live',
          component: () => import('@/views/live.vue'),
          meta: {
            title: '直播中心'
          },
        },
        {
          path: '/internet',
          name: 'internet',
          component: () => import('@/views/internet.vue'),
          meta: {
            title: '流量中心'
          },
        },
        {
          path: '/monitor',
          name: 'monitor',
          component: () => import('../views/monitor.vue'),
          meta: {
            title: '监测中心'
          },
        },
        {
          path: '/anchor',
          name: 'anchor',
          component: () => import('@/views/anchor.vue'),
          meta: {
            title: '企业管理'
          },
        },
        {
          path: '/party',
          name: 'party',
          component: () => import('@/views/party.vue'),
          meta: {
            title: '用户管理'
          },
        },
        {
          path: '/complaint',
          name: 'complaint',
          component: () => import('@/views/complaint.vue'),
          meta: {
            title: '投诉管理'
          },
        },
        {
          path: '/daily',
          name: 'daily',
          component: () => import('@/views/daily.vue'),
          meta: {
            title: '日志管理'
          },
        },
        {
          path: '/setup',
          name: 'setup',
          component: () => import('@/views/setup.vue'),
          meta: {
            title: '账号管理'
          },
        },{
          path: '/plan',
          name: 'plan',
          component: () => import('@/views/plan.vue'),
          meta: {
            title: '直播计划'
          },
        },
        {
          path: '/personCenter',
          name: 'personCenter',
          component: () => import('@/views/personCenter.vue'),
          meta: {
            title: '个人中心'
          },
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login.vue'),
    },

  ],
})

export default router
